

#import <Foundation/Foundation.h>



typedef void (^NormalVoidBlock)(void);

typedef void (^NormalBlock)(id selfPtr);

typedef void (^NormalCompletionBlock)(id selfPtr, BOOL isFinished);


@interface NSObject (Block)

- (void)excuteBlock:(NormalBlock)block;

- (void)performBlock:(NormalBlock)block;

- (void)performBlock:(NormalBlock)block afterDelay:(NSTimeInterval)delay;

- (void)excuteCompletion:(NormalCompletionBlock)block withFinished:(NSNumber *)finished;

- (void)performCompletion:(NormalCompletionBlock)block withFinished:(BOOL)finished;

// 并发执行tasks里的作务，等tasks执行行完毕，回调到completion
- (void)asynExecuteCompletion:(NormalBlock)completion tasks:(NormalBlock)task, ... NS_REQUIRES_NIL_TERMINATION;

@end
